package com.example.safeassistan.home.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.example.safeassistan.R;
import com.example.safeassistan.base.BaseActivity;
import com.example.safeassistan.home.adapter.ExecuteUnitAdapter;

import java.util.ArrayList;
import java.util.List;

public class ExcuteUnitPersonActivity extends BaseActivity implements View.OnClickListener {
    private ExecuteUnitAdapter adapter;
    private RecyclerView rcView;
    private List<String> data;
    private TextView _barTvRight;

    public static void actionStart(Context context) {
        Intent intent = new Intent(context, ExcuteUnitPersonActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected void init(Bundle savedInstanceState) {
        setAndroidNativeLightStatusBar(true);
    }

    @Override
    protected int setLayoutResourceID() {
        return R.layout.execute_unit;
    }

    @Override
    protected void initView() {
        setTitleText("执行单位");
        rcView=findViewById(R.id.rcView);
        _barTvRight=findViewById(R.id._barTvRight);
        _barTvRight.setTextColor(getResources().getColor(R.color.blue_3B5BEA));
        _barTvRight.setVisibility(View.VISIBLE);
        _barTvRight.setText("完成");
        _barTvRight.setOnClickListener(this);

        data=new ArrayList<>();
        for(int i=0;i<10;i++){
            data.add("哈哈哈");
        }
        adapter=new ExecuteUnitAdapter(data);
        rcView.setLayoutManager(new LinearLayoutManager(getContext()));
        rcView.setAdapter(adapter);
    }

    @Override
    protected void initData() { }

    @Override
    protected int getTitleBarType() {
        return 0;
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id._barTvRight:
                //完成
                break;
        }
    }
}